package com.salesys.gr.gui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;

import com.salesys.gr.util.FrmHelper;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.events.TraverseEvent;

public class FrmAbout {

	protected Shell AboutFrm;

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		AboutFrm.open();
		AboutFrm.layout();
		while (!AboutFrm.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 * @wbp.parser.entryPoint
	 */
	protected void createContents() {
		AboutFrm = new Shell(SWT.CLOSE | SWT.APPLICATION_MODAL);
		AboutFrm.addTraverseListener(new TraverseListener() {
			public void keyTraversed(TraverseEvent arg0) {
				if (arg0.keyCode == 27) {
					AboutFrm.close();
				}
			}
		});
		AboutFrm.setSize(450, 300);
		AboutFrm.setText("关于黑色素加盟销售系统");

		// 窗口居中
		AboutFrm.setLocation(new FrmHelper().setLocationCenter(AboutFrm));

		Label lblAboutImage = new Label(AboutFrm, SWT.NONE);
		lblAboutImage.setImage(SWTResourceManager.getImage(FrmAbout.class, "/com/salesys/tony/gui/resource/logo.jpg"));
		lblAboutImage.setBounds(10, 10, 160, 252);

		Label lblNewLabel = new Label(AboutFrm, SWT.NONE);
		lblNewLabel.setAlignment(SWT.CENTER);
		lblNewLabel.setBounds(187, 10, 247, 252);
		lblNewLabel.setText("\r\n黑色素加盟销售系统\r\n\r\n版本：1.5.0.1\r\n\r\n作者：Tony Techzero\r\n\r\nCopyright by 台湾科大光学有限公司 © 2013");

	}
}
